Python built-in data operations (1) --- string str, pythonstr
S. capitalize ()-> str Return a capitalized version of S, I. e. make the first character have upper case and the rest lower case.Returns an upper-case string that converts the first
Vamei Source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!In the quick tutorial, we learned about the most basic sequence (sequence). Recall that the sequence contains a fixed value table (tuple) and a
Types of str and bytes in Python3One of the most important new features of Python3 is a clear distinction between string and binary data streams. Text is always Unicode, represented by the STR type, and binary data is represented by the bytes type.
What is a regular expression?Many programming languages support regular expressions. This article only discusses Regular Expressions in JavaScript.
Create a regular expressionMethod 1:
Var reg =/pattern/; Method 2:
Var reg = new RegExp ('pattern');
In this article I would like to say a python string in the standard numeric type in Python, str (), in the hope that it will help you to just touch python.
python Strings (string):
Python strings are a string of characters consisting of numbers,
Introduction to Python str class methods
#capitalize (): string first character uppercase String = ' This is a string. ' New_str = String.capitalize () print (NEW_STR) #输出: The is a string. #center (width, fillchar=none): Place the string in the
Document directory
C {n}
C {m, n}
C {n ,}
*, + ,?
Greedy and non-greedy
Matching results of sub-regular expressions are not recorded
Forward pre-Query
?!
Global match, modifier g
Case-insensitive, modifier I
The end of the first line,
Leetcode problem solving substring with concatenation of the all words original questionAn existing set of string words of equal length, to find the starting position of the substring in the original string that exactly contains all the strings in
functions defined within the STR type
Capitalize: Capitalize the first letter, the remaining lowercaseFunction prototype: def capitalize (self)Usage:
Str1.capitalize ()
Casefold: Change All lowercaseFunction prototype: def
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.